Special-case shift-tab and map it to GDK_ISO_Left_Tab, fixes bug #350806.
authorRichard Hult <richard@imendio.com>
Wed, 6 Sep 2006 17:29:28 +0000 (17:29 +0000)
committerRichard Hult <rhult@src.gnome.org>
Wed, 6 Sep 2006 17:29:28 +0000 (17:29 +0000)
2006-09-06  Richard Hult  <richard@imendio.com>

* gdk/quartz/gdkkeys-quartz.c: (maybe_update_keymap): Special-case
shift-tab and map it to GDK_ISO_Left_Tab, fixes bug #350806.

ChangeLog
gdk/quartz/gdkkeys-quartz.c

index a4ecd66b59059a1472b552d476e548383d74d792..f05d7583f723924d3892011fd8081ee39dfd3d73 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-06  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkkeys-quartz.c: (maybe_update_keymap): Special-case 
+       shift-tab and map it to GDK_ISO_Left_Tab, fixes bug #350806.
+
 2006-09-04  Kristian Rietveld  <kris@imendio.com>
 
        * gtk/gtkfilechooserdefault.c (update_current_folder_get_info_cb):
index c148c6d861ebd518b647b249a4e917c9c3f9387a..9d62b435080903a4a1e443d9694988f5eba48a2b 100644 (file)
@@ -206,7 +206,7 @@ maybe_update_keymap (void)
          for (i = 0; i < NUM_KEYCODES; i++) 
            {
              int j;
-             UInt32 modifiers[] = {0, shiftKey, optionKey, shiftKey|optionKey};
+             UInt32 modifiers[] = {0, shiftKey, optionKey, shiftKey | optionKey};
 
              p = keyval_array + i * KEYVALS_PER_KEYCODE;
              
@@ -216,7 +216,7 @@ maybe_update_keymap (void)
                  UInt16 key_code;
                  UniChar uc;
                  
-                 key_code = modifiers[j]|i;
+                 key_code = modifiers[j] | i;
                  c = KeyTranslate (chr_data, key_code, &state);
 
                  if (state != 0)
@@ -248,6 +248,12 @@ maybe_update_keymap (void)
                            }
                        }
                      
+                     /* Special-case shift-tab since GTK+ expects
+                      * GDK_ISO_Left_Tab for that. 
+                      */
+                     if (found && p[j] == GDK_Tab && modifiers[j] == shiftKey) 
+                       p[j] = GDK_ISO_Left_Tab;
+
                      if (!found)
                        p[j] = gdk_unicode_to_keyval (uc);
                    }
@@ -275,7 +281,7 @@ maybe_update_keymap (void)
          for (i = 0; i < NUM_KEYCODES; i++) 
            {
              int j;
-             UInt32 modifiers[] = {0, shiftKey, optionKey, shiftKey|optionKey};
+             UInt32 modifiers[] = {0, shiftKey, optionKey, shiftKey | optionKey};
               UniChar chars[4];
               UniCharCount nChars;
 
@@ -288,7 +294,7 @@ maybe_update_keymap (void)
                  UInt16 key_code;
                  UniChar uc;
                  
-                 key_code = modifiers[j]|i;
+                 key_code = modifiers[j] | i;
                  err = UCKeyTranslate (chr_data, i, kUCKeyActionDown,
                                        (modifiers[j] >> 8) & 0xFF,
                                        LMGetKbdType(),